package com.lq.memo.service.impl;

import com.lq.memo.entity.MemoTimes;
import com.lq.memo.service.MemoTimesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: memo
 * @description:
 * @author: LQ
 * @create: 2021-11-08 13:06
 */
@Service
public class MemoTimesServiceImpl implements MemoTimesService {
    @Autowired
    private JdbcTemplate template;

    @Override
    public List<MemoTimes> getAllMemoTimes() {
        String sql = "select * from memo_times ";
        List<MemoTimes> memoTimesList = template.query(sql, new BeanPropertyRowMapper<>(MemoTimes.class));
        return memoTimesList;
    }
}
